<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Home extends MX_Controller
{
    private $module = 'home';
    private $table = 'news';

    function __construct()
    {
        parent::__construct();
        $this->load->model($this->module . '_model', 'model');
        $this->load->model('admincp_modules/admincp_modules_model');

        $this->template->write('title', '');
        $this->template->write('meta_keywords', '');
        $this->template->write('meta_description', '');
        $this->template->write('meta_image', '');
        $this->template->write('meta_video', '');
    }

    /*-------------------------------------- FrontEnd --------------------------------------*/
//    Page
    function index()
    {
        $data['result'] = '';
        $this->template->write_view('content', 'FRONTEND/index', $data);
        $this->template->write('meta_keywords', META_KEY);
        $this->template->write('meta_description', META_DESC);
        $this->template->write('title', 'Trang chủ | ' . getSiteName());
        $this->template->render();
    }

// Block
    function _blockListBook()
    {
        $data['list'] = $this->model->getListNewBook();
        $this->load->view('FRONTEND/blocks/list_new_book', $data);
    }

    function _blockRightBook()
    {
        $data['support'] = $this->model->getSetting();
        $this->load->view('FRONTEND/blocks/right_list_block', $data);
    }

    function _blockSlide()
    {
        $data['slide'] = $this->model->getSetting();
        $this->load->view('FRONTEND/blocks/slide_book', $data);
    }


}